<template>
    <div class="homeaside">
        <el-menu router :default-active="route.path" class="el-menu-vertical-demo" @open="handleOpen"
            @close="handleClose">
            <el-sub-menu :index="item.path" v-for="item in asideList" :key="item.path">
                <template #title>
                    <el-icon>
                        <location />
                    </el-icon>
                    <span>{{ item.meta.title }}</span>
                </template>
                <el-menu-item :index="item1.path" v-for="item1 in item.children" :key="item1.path">
                    {{ item1.meta.title }}
                </el-menu-item>
            </el-sub-menu>
        </el-menu>
    </div>
</template>
<script setup lang="ts">
import {
    Document,
    Menu as IconMenu,
    Location,
    Setting,
} from '@element-plus/icons-vue'
import { useRouter, useRoute } from 'vue-router'
import { ref } from 'vue'
const router = useRouter()
const route = useRoute()
let asideList: any = ref([])
router.getRoutes().forEach((item: any) => {
    if (item.path == '/home') {
        asideList = item.children
    }
})

const handleOpen = (key: string, keyPath: string[]) => {
}
const handleClose = (key: string, keyPath: string[]) => {
}
</script>

<style scoped></style>